package com.xbts.system.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Data;
import java.util.Objects;
import javax.validation.constraints.NotNull;
import com.xbts.common.annotation.Excel;
import com.xbts.common.utils.StringUtils;
import com.xbts.common.core.domain.BaseEntity;

/**
 * 新闻类型对象 cn_news_type
 *
 * @author xbts
 * @date 2023-09-05
 */
@Data
@ApiModel("新闻类型对象")
@TableName("cn_news_type")
public class CnNewsType extends BaseEntity {

    private static final long serialVersionUID=1L;

    /** 新闻类型主键 */
    @TableId
    private Long newsTypeId;

    /** 新闻类型名称 */
    @Excel(name = "新闻类型名称")
    @ApiModelProperty("新闻类型名称")
    @NotNull(message = "新闻类型名称不能为空")
    private String newsTypeName;

    public<T> QueryWrapper<T> queryWrapper(){
        QueryWrapper<T> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq(!Objects.isNull(newsTypeName),"news_type_name",newsTypeName);
        return queryWrapper;
    }
}